import time
from public.action import *
from public.business import *
from public.testData import *
from public.tools import *

testcase = "dbshop015-添加侧边设置"

firefox = openBrowser(urlAdmin)
DBshopLoginAdmin(firefox)

# 1.点击“添加侧边设置”按钮，
DBshopEnterMenu3(firefox,"商品管理","管理分类","前台侧边设置")

firefox.find_element_by_xpath('//a[@class="btn btn-small btn-primary"]').click()
# 显示名称“网站很好看”，排序255，点击“保存侧边显示信息”。
firefox.find_element_by_id("frontside_name").send_keys(frontsideName)
firefox.find_element_by_xpath('//button[contains(text(),"保存侧边显示信息")]').click()
time.sleep(5)
# 2.保存成功信息

try:
    firefox.find_element_by_xpath('//td[contains(.,"%s")]'%(frontsideName)).is_displayed()
    writeLog("%s 测试通过"%testcase)
    getPhoto(firefox)
except:
    writeLog("%s 测试失败" % testcase)
# firefox.quit()